package com.example.zsr.mydownloadmanager;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.example.zsr.mydownloadmanager.MesInfo.FilesInfo;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "zsr";

    public static final String apkUrl = "http://images.infzm.com/mobile/infzmreader.apk";

    private String fileDir ;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        fileDir = getFilesDir()+"/mydownload/";
    }



    public void download(View view){

       FilesInfo filesInfo = new FilesInfo(apkUrl,5,fileDir,"南方周末");

        Intent downloadservice = new Intent(MainActivity.this,DownloadManager.class);
        downloadservice.putExtra("fileinfo",filesInfo);

        startService(downloadservice);

    }




}
